home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / dev / basic / hsb_reqt_inc.lha / hsb_reqt_inc / example / ReqToolsDemo.bas < prev    next >
BASIC Source File  |  1997-04-21  |  17KB  |  513 lines

  1. '    reqtoolsdemo.bas, based on demo.c from the reqtools package
  2. '    for HiSoft/Maxon Basic by Steffen Leistner 1995
  3. '    email: steffen.leistner@styx.in-chemnitz.de
  4. '    this file is public domain
  5. '    Tabwidth = 4
  6. '    Includeversion 42 (3.1)
  7.  
  8. REM $NOWINDOW
  9. REM $NOLIBRARY
  10.  
  11. REM $INCLUDE exec.bh
  12. REM $INCLUDE dos.bh
  13. REM $INCLUDE intuition.bh
  14. REM $INCLUDE graphics.bh
  15. REM $INCLUDE reqtools.bh
  16. REM $INCLUDE utility.bh
  17.  
  18. CONST minver&     = 37&            'needs Kickstart 37+ (2.0)
  19. CONST rtver&    = 38&            'reqtools-version 38+
  20. CONST wbufsize&    = 512&
  21. CONST tagptr&    = 384&
  22.  
  23. LIBRARY OPEN "exec.library", minver&
  24. LIBRARY OPEN "intuition.library", minver&
  25. LIBRARY OPEN "reqtools.library", rtver&
  26.  
  27. '----------------------------------------------------------------------------
  28.  
  29. 'a simpel filterhook for the file requester
  30.  
  31. FUNCTION FilterDemo&(BYVAL hk&, BYVAL freq&, BYVAL fib&)
  32.     STATIC t$                                            'for more speed
  33.     t$ = PEEK$(fib& + fib_Filename%)
  34.     IF INSTR(t$, "a")
  35.         PRINT t$
  36.         FilterDemo& = FALSE&
  37.     ELSE
  38.         FilterDemo& = TRUE&
  39.     END IF
  40. END FUNCTION 
  41.  
  42. '---------------------------------------------------------------------------
  43.  
  44. FUNCTION Demo&
  45.  
  46.     '512 byte, enough workspace for stringoperations and taglists:
  47.     
  48.     wbuf& = AllocVec& (wbufsize&, MEMF_PUBLIC& OR MEMF_CLEAR&)
  49.     IF wbuf& = NULL&
  50.         EXIT FUNCTION
  51.     END IF
  52.     tagb& = wbuf& + tagptr&                 'buffersection for taglists
  53.     
  54.     
  55.     r$ = CHR$(10) : n$ = CHR$(0)            'newline, stringtermination
  56.     
  57.     '--- Startup ------------------------------------------------------------
  58.     
  59.     junk& = rtEZRequestA& (SADD("ReqTools 2.0 Demo" + r$ + _
  60.                                 "~~~~~~~~~~~~~~~~~" + r$ + _
  61.                                 "'reqtools.library' offers several" + r$ + _
  62.                                 "different types of requesters:" + n$), _
  63.                             SADD("Let's see them" + n$), _
  64.                             NULL&, NULL&, NULL&)
  65.                             
  66.     junk& = rtEZRequestA& (SADD("NUMBER 1:" + r$ + _
  67.                                 "The larch :-)" + n$), + _
  68.                             SADD("Be serious!" + n$), _
  69.                             NULL&, NULL&, NULL&)
  70.                             
  71.     '--- rtGetStringA -------------------------------------------------------
  72.     
  73.     junk& = rtEZRequestA& (SADD("NUMBER 1:" + r$ + _
  74.                                 "String requester" + r$ + _
  75.                                 "function: rtGetStringA&"+ n$), + _
  76.                             SADD("Show me" + n$), _
  77.                             NULL&, NULL&, NULL&)
  78.     
  79.     tmp$ = "A bit of text" + n$
  80.     CopyMem SADD(tmp$), wbuf&, LEN(tmp$)
  81.     
  82.     IF rtGetStringA& (wbuf&, tagptr& - 2, SADD("Enter anything:" + n$), NULL&, NULL&)
  83.         junk& = rtEZRequestA& (SADD("You entered this string:" + r$ + _ 
  84.                                 "'" + PEEK$(wbuf&) + "'" + n$), + _
  85.                                 SADD("So I did" + n$), _
  86.                                 NULL&, NULL&, NULL&)
  87.     ELSE
  88.         junk& = rtEZRequestA& (SADD("You entered nothing :-(" + n$), + _
  89.                                 SADD("I'm sorry" + n$), _
  90.                                 NULL&, NULL&, NULL&)
  91.     END IF
  92.     
  93.     TAGLIST tagb&, _
  94.         RTGS_GadFmt&,    " _Ok |New _2.0 feature!|_Cancel", _
  95.         RTGS_TextFmt&,    "These are two new features of ReqTools 2.0:" + r$ + _
  96.                          "Text above the entry gadget and more than" + r$ + _
  97.                          "one response gadget.", _
  98.         RT_Underscore&,    "_"%, _
  99.     TAG_END&
  100.     
  101.     IF rtGetStringA&    (wbuf&, tagptr& - 2, SADD("Enter anything:" + n$), _
  102.                         NULL&, tagb&) = 2
  103.  
  104.         junk& = rtEZRequestA& (SADD("Yep, this is a new" + r$ + _ 
  105.                                 "ReqTools 2.0 feature!" + n$), + _
  106.                                 SADD("Oh boy!" + n$), _
  107.                                 NULL&, NULL&, NULL&)
  108.     END IF
  109.  
  110.     TAGLIST tagb&, _
  111.         RTGS_GadFmt&,    " _Ok |_Abort|_Cancel", _
  112.         RTGS_TextFmt&,    "New is also the ability to switch off the" + r$ + _
  113.                          "backfill pattern.  You can also center the" + r$ + _
  114.                          "text above the entry gadget." + r$ + _
  115.                          "These new features are also available in" + r$ + _
  116.                          "the rtGetLong() requester.", _
  117.         RTGS_BackFill&,    FALSE&, _
  118.         RTGS_Flags&,     GSREQ_CENTERTEXT& OR GSREQ_HIGHLIGHTTEXT&, _
  119.         RT_Underscore&,    "_"%, _
  120.     TAG_END&
  121.  
  122.     IF rtGetStringA&    (wbuf&, tagptr& - 2, SADD("Enter anything:" + n$), _
  123.                         NULL&, tagb&) = 2
  124.  
  125.         junk& = rtEZRequestA& (SADD("What!! You pressed abort!?!" + r$ + _ 
  126.                                 "You must be joking :-)" + n$), + _
  127.                                 SADD("Ok, Continue" + n$), _
  128.                                 NULL&, NULL&, NULL&)
  129.     END IF
  130.  
  131.     '--- rtGetLongA ---------------------------------------------------------
  132.  
  133.     junk& = rtEZRequestA& (SADD("NUMBER 2:" + r$ + _
  134.                                 "Number requester" + r$ + _
  135.                                 "function: rtGetLongA&"+ n$), + _
  136.                             SADD("Show me" + n$), _
  137.                             NULL&, NULL&, NULL&)
  138.  
  139.     TAGLIST tagb&, _
  140.         RTGL_ShowDefault&,    FALSE&, _
  141.         RTGL_Min&,            0&, _ 
  142.         RTGL_Max&,             666&, _
  143.     TAG_END&
  144.  
  145.     IF rtGetLongA&(VARPTR(longnum&), SADD("Enter a number:" + n$), NULL&, tagb&)
  146.         junk& = rtEZRequestA& (SADD("The number you entered was:" + r$ + _
  147.                                     LTRIM$(STR$(longnum&)) + n$), + _
  148.                                 SADD("So it was" + n$), _
  149.                                 NULL&, NULL&, NULL&)
  150.     ELSE
  151.         junk& = rtEZRequestA& (SADD("You entered nothing :-(" + n$), + _
  152.                                 SADD("I'm sorry" + n$), _
  153.                                 NULL&, NULL&, NULL&)
  154.     END IF
  155.  
  156.     '--- rtEZRequestA -------------------------------------------------------
  157.  
  158.     junk& = rtEZRequestA& (SADD("NUMBER 3:" + r$ + _
  159.                                 "Message requester, the requester" + r$ + _
  160.                                 "you've been using all the time!" + r$ + _
  161.                                 "function: rtEZRequestA&"+ n$), + _
  162.                             SADD("Show me more" + n$), _
  163.                             NULL&, NULL&, NULL&)
  164.     
  165.     junk& = rtEZRequestA& (SADD("Simplest usage: some body text and" + r$ + _
  166.                                 "a single centered gadget."+ n$), + _
  167.                             SADD("Go it" + n$), _
  168.                             NULL&, NULL&, NULL&)
  169.  
  170.     WHILE rtEZRequestA& (SADD("You can also use two gadgets to" + r$ + _
  171.                                     "ask the user something." + r$ + _
  172.                                     "Do you understand?"+ n$), + _
  173.                                 SADD("Of course|Not really" + n$), _
  174.                                 NULL&, NULL&, NULL&) = FALSE&
  175.  
  176.         junk& = rtEZRequestA& (SADD("You are not one of the brightest are you?" + r$ + _
  177.                                     "We'll try again..."+ n$), + _
  178.                                 SADD("Ok" + n$), _
  179.                                 NULL&, NULL&, NULL&)
  180.     WEND
  181.  
  182.     junk& = rtEZRequestA& (SADD("Great, we'll continue then." + n$), _
  183.                                 SADD("Fine" + n$), _
  184.                                 NULL&, NULL&, NULL&)
  185.  
  186.     ret& = rtEZRequestA& (SADD("You can also put up a requester with" + r$ + _
  187.                                 "three choices." + r$ + _
  188.                                 "How do you like the demo so far ?"+ n$), + _
  189.                             SADD("Great|So so|Rubbish" + n$), _
  190.                             NULL&, NULL&, NULL&)
  191.     SELECT CASE ret&
  192.         CASE FALSE&
  193.             junk& = rtEZRequestA& (SADD("Too bad, I really hoped you" + r$ + _
  194.                                         "would like it better." + n$), _
  195.                                     SADD("So what" + n$), _
  196.                                     NULL&, NULL&, NULL&)
  197.         CASE TRUE&
  198.             junk& = rtEZRequestA& (SADD("I'm glad you like it so much." + n$), _
  199.                                     SADD("Fine" + n$), _
  200.                                     NULL&, NULL&, NULL&)
  201.         CASE 2&
  202.             junk& = rtEZRequestA& (SADD("Maybe if you run the demo again" + r$ + _
  203.                                         "you'll REALLY like it." + n$), _
  204.                                     SADD("Perhaps" + n$), _
  205.                                     NULL&, NULL&, NULL&)
  206.     END SELECT
  207.     
  208.     TAGLIST tagb&, RTEZ_DefaultResponse&, 4&, TAG_END&
  209.     
  210.     ret& = rtEZRequestA& (SADD("The number of responses is not limited to three" + r$ + _
  211.                                 "as you can see.  The gadgets are labeled with" + r$ + _
  212.                                 "the return code from rtEZRequest()." + r$ + _
  213.                                 "Pressing Return will choose 4, note that" + r$ + _
  214.                                 "4's button text is printed in boldface." + n$), + _
  215.                             SADD("1|2|3|4|5|0" + n$), _
  216.                             NULL&, NULL&, tagb&)
  217.     
  218.     junk& = rtEZRequestA& (SADD("You picked " + LTRIM$(STR$(ret&)) + n$), + _
  219.                                 SADD("How true" + n$), _
  220.                                 NULL&, NULL&, NULL&)
  221.  
  222.     TAGLIST tagb&, RT_Underscore&, "_"%, TAG_END&                        
  223.     
  224.     ret& = rtEZRequestA& (SADD("New for Release 2.0 of ReqTools (V38) is" + r$ + _
  225.                                 "the possibility to define characters in the" + r$ + _
  226.                                 "buttons as keyboard shortcuts." + r$ + _
  227.                                 "As you can see these characters are underlined." + r$ + _
  228.                                 "Pressing shift while still holding down the key" + r$ + _
  229.                                 "will cancel the shortcut." + r$ + _
  230.                                 "Note that in other requesters a string gadget may" + r$ + _
  231.                                 "be active.  To use the keyboard shortcuts there" + r$ + _
  232.                                 "you have to keep the Right Amiga key pressed down." + n$), + _
  233.                             SADD("_Great|_Fantastic|_Swell|Oh _Boy" + n$), _
  234.                             NULL&, NULL&, tagb&)
  235.  
  236.     TAGLIST tagb&, _
  237.         RT_Underscore&, "_"%, _
  238.         RT_IDCMPFlags&, IDCMP_DISKINSERTED&, _
  239.     TAG_END&
  240.     
  241.     IF rtEZRequestA& (SADD("It is also possible to pass extra IDCMP flags" + r$ + _
  242.                             "that will satisfy rtEZRequest(). This requester" + r$ + _
  243.                             "has had DISKINSERTED passed to it." + r$ + _
  244.                             "(Try inserting a disk)." + n$), + _
  245.                         SADD("_Continue" + n$), _
  246.                         NULL&, NULL&, tagb&)
  247.  
  248.         junk& = rtEZRequestA& (SADD("You inserted a disk." + n$), _
  249.                                 SADD("I did" + n$), _
  250.                             NULL&, NULL&, NULL&)
  251.     ELSE
  252.         junk& = rtEZRequestA& (SADD("You used the 'Continue' gadget." + n$), _
  253.                                 SADD("I did" + n$), _
  254.                             NULL&, NULL&, NULL&)
  255.     END IF
  256.  
  257.     TAGLIST tagb&, _
  258.         RT_Underscore&, "_"%, _
  259.         RT_ReqPos&,        REQPOS_TOPLEFTSCR&, _
  260.     TAG_END&
  261.     
  262.     junk& = rtEZRequestA& (SADD("Finally, it is possible to specify the position" + r$ + _
  263.                                 "of the requester." + r$ + _
  264.                                 "E.g. at the top left of the screen, like this." + r$ + _
  265.                                 "This works for all requesters, not just rtEZRequest()!" + n$), + _
  266.                             SADD("_Amazing" + n$), _
  267.                             NULL&, NULL&, tagb&)
  268.  
  269.     TAGLIST tagb&, RT_ReqPos&, REQPOS_CENTERSCR&, TAG_END&
  270.  
  271.     junk& = rtEZRequestA& (SADD("Alternatively, you can center the" + r$ + _
  272.                                 "requester on the screen." + r$ + _
  273.                                 "Check out 'reqtools.bh' for all the possibilities." + n$), + _
  274.                             SADD("I'll do that" + n$), _
  275.                             NULL&, NULL&, tagb&)
  276.  
  277.     '--- rtFileRequest ------------------------------------------------------
  278.  
  279.     TAGLIST tagb&, RT_Underscore&, "_"%, TAG_END&
  280.     
  281.     junk& = rtEZRequestA& (SADD("NUMBER 4:" + r$ + _
  282.                                 "File requester" + r$ + _
  283.                                 "function: rtFileRequestA&" + n$), + _
  284.                             SADD("_Demonstrate" + n$), _
  285.                             NULL&, NULL&, tagb&)
  286.     
  287.     fhook& = AllocVec&(Hook_sizeof%, MEMF_PUBLIC& OR MEMF_CLEAR&)
  288.     INITHOOK fhook&, VARPTRS(FilterDemo&)
  289.     
  290.     POKEB wbuf&, 0%
  291.     TAGLIST tagb&, RTFI_FilterFunc& , fhook&, TAG_END&
  292.     
  293.     filereq& = rtAllocRequestA&(RT_FILEREQ&, NULL&)
  294.     IF filereq&
  295.         
  296.         WINDOW 1,"Simple Filterhook - Demo",(10,20) - (PEEKW(SYSTAB) \ 3, PEEKW(SYSTAB + 2) - 40), 23
  297.         PRINT "These Filenames includes a 'a' and"
  298.         PRINT "turn out in the Listview:" : PRINT
  299.         
  300.         IF rtFileRequestA&(filereq&, wbuf&, SADD("Pick a File:" + n$), tagb&)
  301.             junk& = rtEZRequestA& (SADD("You picked the file:" + r$ +_
  302.                                         PEEK$(wbuf&) + r$ + _
  303.                                         "in directory:" + r$ + _
  304.                                         PEEK$(PEEKL(filereq& + rtfi_Dir%)) + n$), _
  305.                                     SADD("Right" + n$), _
  306.                                     NULL&, NULL&, NULL&)
  307.         ELSE
  308.             junk& = rtEZRequestA& (SADD("You didn't pick a file." + n$), _
  309.                                     SADD("No" + n$), _
  310.                                     NULL&, NULL&, NULL&)
  311.         END IF
  312.     
  313.         SetWindowTitles WINDOW(7), NULL&, NULL&
  314.         CLS
  315.         
  316.         TAGLIST tagb&, RT_Underscore&, "_"%, TAG_END&
  317.     
  318.         junk& = rtEZRequestA& (SADD("The file requester has the ability" + r$ + _
  319.                                     "to allow you to pick more than one" + r$ + _
  320.                                     "file (use Shift to extend-select)." + r$ + _
  321.                                     "Note the extra gadgets you get." + n$), + _
  322.                                 SADD("_Interesting" + n$), _
  323.                                 NULL&, NULL&, tagb&)
  324.     
  325.         TAGLIST tagb&, RTFI_Flags&, FREQ_MULTISELECT&, TAG_END&
  326.     
  327.         flist& = rtFileRequestA&(filereq&, wbuf&, SADD("Pick some Files:" + n$), tagb&)
  328.     
  329.         IF flist&
  330.             SetWindowTitles WINDOW(7), SADD("Selected Entrys:" + n$), NULL&
  331.  
  332.             tempflist& = flist&
  333.             WHILE tempflist&
  334.                 PRINT PEEK$(PEEKL(tempflist& + rtfl_Name%))
  335.                 tempflist& = PEEKL(tempflist& + rtfl_Next%)
  336.             WEND
  337.             rtFreeFileList flist&
  338.         
  339.             junk& = rtEZRequestA& (SADD("See results in the left window." + n$), _
  340.                                         SADD("Yeah" + n$), _
  341.                                         NULL&, NULL&, NULL&)
  342.         END IF    
  343.         WINDOW CLOSE 1
  344.         
  345.         junk& = rtEZRequestA& (SADD("The file requester can be used" + r$ + _
  346.                                     "as a directory requester as well."+ n$), _
  347.                                     SADD("Let's see that" + n$), _
  348.                                     NULL&, NULL&, NULL&)
  349.         
  350.         TAGLIST tagb&, RTFI_Flags&, FREQ_NOFILES&, TAG_END&
  351.         POKEB wbuf&, 0%
  352.         
  353.         IF rtFileRequestA&(filereq&, wbuf&, SADD("Pick a diretory:" + n$), tagb&)
  354.             junk& = rtEZRequestA& (SADD("You picked the directory:" + r$ + _
  355.                                         PEEK$(PEEKL(filereq& + rtfi_Dir%)) + n$), _
  356.                                         SADD("Right" + n$), _
  357.                                         NULL&, NULL&, NULL&)
  358.         ELSE
  359.             junk& = rtEZRequestA& (SADD("You didn't pick a directory." + n$), _
  360.                                         SADD("No" + n$), _
  361.                                         NULL&, NULL&, NULL&)
  362.         END IF    
  363.         rtFreeRequest filereq&
  364.     END IF
  365.     
  366.     FreeVec fhook&
  367.     
  368.     '--- rtFontRequest ------------------------------------------------------
  369.  
  370.     junk& = rtEZRequestA& (SADD("NUMBER 5:" + r$ + _
  371.                                 "Font Requester" + r$ + _
  372.                                 "function: rtFontRequestA&" + n$), _
  373.                             SADD("Show" + n$), _
  374.                             NULL&, NULL&, NULL&)
  375.         
  376.     fontreq& = rtAllocRequestA&(RT_FONTREQ&, NULL&)
  377.     IF fontreq&
  378.         POKEL fontreq& + rtfo_Flags%, FREQ_STYLE& OR FREQ_COLORFONTS&
  379.         
  380.         IF rtFontRequestA&(fontreq&, SADD("Pick a Font:" + n$), NULL&)
  381.             fontname$ = PEEK$(PEEKL(fontreq& + rtfo_Attr% + ta_Name%))
  382.             fontsize% = PEEKW(fontreq& + rtfo_Attr% + ta_YSize%)
  383.             junk& = rtEZRequestA& (SADD("You picked the font:" + r$ + _
  384.                                         fontname$ + r$ + _
  385.                                         "with size:" + STR$(fontsize%) + n$), _
  386.                                     SADD("Right" + n$), _
  387.                                     NULL&, NULL&, NULL&)
  388.         ELSE
  389.             junk& = rtEZRequestA& (SADD("You canceled." + r$ + _
  390.                                         "Was there no font you liked ?" + n$), _
  391.                                     SADD("Nope" + n$), _
  392.                                     NULL&, NULL&, NULL&)
  393.         END IF
  394.         rtFreeRequest fontreq&
  395.     END IF
  396.     
  397.     '--- rtPaletteRequest ---------------------------------------------------
  398.     
  399.     junk& = rtEZRequestA& (SADD("NUMBER 6:" + r$ + _
  400.                                 "Palette Requester" + r$ + _
  401.                                 "function: rtPaletteRequestA&" + n$), _
  402.                             SADD("Proceed" + n$), _
  403.                             NULL&, NULL&, NULL&)
  404.         
  405.     col& = rtPaletteRequestA& (SADD("Change palette:" + n$), NULL&, NULL&)
  406.     
  407.     IF col& = -1
  408.         junk& = rtEZRequestA& (SADD("You canceled." + r$ + _
  409.                                     "No nice colors to be picked ?" + n$), _
  410.                                     SADD("Nah" + n$), _
  411.                                     NULL&, NULL&, NULL&)
  412.     ELSE
  413.         junk& = rtEZRequestA& (SADD("You picked color number" + STR$(col&) + n$), _
  414.                                     SADD("Sure did" + n$), _
  415.                                     NULL&, NULL&, NULL&)
  416.     END IF
  417.     
  418.     '--- [VolumeRequest] ----------------------------------------------------
  419.     
  420.     junk& = rtEZRequestA& (SADD("NUMBER 7: (ReqTools 2.0)" + r$ + _
  421.                                 "Volume Requester" + r$ + _
  422.                                 "function: rtFileRequestA&" + n$), _
  423.                             SADD("Show me" + n$), _
  424.                             NULL&, NULL&, NULL&)
  425.     
  426.     TAGLIST tagb&, RTFI_VolumeRequest&, NULL&, TAG_END&
  427.     
  428.     filereq& = rtAllocRequestA&(RT_FILEREQ&, NULL&)
  429.     IF filereq&
  430.                 
  431.         IF rtFileRequestA&(filereq&, wbuf&, SADD("Pick a Volume:" + n$), tagb&)
  432.             junk& = rtEZRequestA& (SADD("You picked the Volume:" + r$ +_
  433.                                         PEEK$(PEEKL(filereq& + rtfi_Dir%)) + n$), _
  434.                                     SADD("Right" + n$), _
  435.                                     NULL&, NULL&, NULL&)
  436.         ELSE
  437.             junk& = rtEZRequestA& (SADD("You didn't pick a volume." + n$), _
  438.                                     SADD("I did not" + n$), _
  439.                                     NULL&, NULL&, NULL&)
  440.         END IF
  441.         rtFreeRequest filereq&
  442.     END IF
  443.     
  444.     '--- rtScreenModeRequest ------------------------------------------------
  445.  
  446.     junk& = rtEZRequestA& (SADD("NUMBER 8: (ReqTools 2.0)" + r$ + _
  447.                                 "Screen mode requester" + r$ + _
  448.                                 "function: rtScreenModeRequestA&" + n$), _
  449.                             SADD("Show me" + n$), _
  450.                             NULL&, NULL&, NULL&)
  451.     
  452.     scrmodereq& = rtAllocRequestA&(RT_SCREENMODEREQ&, NULL&)
  453.     IF scrmodereq&
  454.         
  455.         TAGLIST tagb&, _
  456.             RTSC_Flags&,    SCREQ_DEPTHGAD& OR SCREQ_SIZEGADS& OR SCREQ_AUTOSCROLLGAD& _
  457.                             OR SCREQ_OVERSCANGAD&, _
  458.         TAG_END&
  459.         
  460.         IF rtScreenModeRequestA&(scrmodereq&, SADD("Pick a screen mode:" + n$), tagb&)
  461.             
  462.             smodeid& =    PEEKL(scrmodereq& + rtsc_DisplayID%)
  463.             swidth% =    PEEKW(scrmodereq& + rtsc_DisplayWidth%)
  464.             sheight% =    PEEKW(scrmodereq& + rtsc_DisplayHeight%)
  465.             sdepth% =    PEEKW(scrmodereq& + rtsc_DisplayDepth%)
  466.             oscant%    =    PEEKW(scrmodereq& + rtsc_OverscanType%)
  467.             SELECT CASE oscant%
  468.                 CASE OSCAN_MAX& : oversc$ = "maximal"
  469.                 CASE OSCAN_STANDARD& : oversc$ = "standard"
  470.                 CASE OSCAN_TEXT& : oversc$ = "text"
  471.                 CASE OSCAN_VIDEO& : oversc$ = "video"
  472.                 CASE REMAINDER : oversc$ = "no"
  473.             END SELECT
  474.              IF PEEKL(scrmodereq& + rtsc_AutoScroll%)
  475.                 ascroll$ = "on"
  476.             ELSE
  477.                 ascroll$ = "off"
  478.             END IF
  479.             
  480.             junk& = rtEZRequestA& (SADD("You picked this mode:" + r$ + _
  481.                                         "ModeID: &H" + HEX$(smodeid&) + r$ + _
  482.                                         "Size:" + STR$(swidth%) + " x "  + _
  483.                                         STR$(sheight%) + r$ + _
  484.                                         "Depth:" + STR$(sdepth%) + r$ + _
  485.                                         "Overscan: " + oversc$ + r$ + _
  486.                                         "AutoScroll: " + ascroll$ + n$), _
  487.                                     SADD("Right" + n$), _
  488.                                     NULL&, NULL&, NULL&)
  489.         ELSE
  490.             junk& = rtEZRequestA& (SADD("You didn't pick a screen mode." + n$), _
  491.                                     SADD("Nope" + n$), _
  492.                                     NULL&, NULL&, NULL&)
  493.         END IF
  494.         rtFreeRequest scrmodereq&
  495.     END IF
  496.  
  497.     '--- Good bye! ----------------------------------------------------------
  498.  
  499.     TAGLIST tagb&, RT_Underscore&, "_"%, TAG_END&
  500.  
  501.     junk& = rtEZRequestA& (SADD("That's it!" + r$ + "Hope you enjoyed the demo." + n$), _
  502.                             SADD("_Sure did" + n$), _
  503.                             NULL&, NULL&, tagb&)
  504.         
  505.     FreeVec wbuf&    
  506.     Demo& = RETURN_OK&
  507. END FUNCTION
  508.  
  509. '----------------------------------------------------------------------------
  510.     
  511. STOP Demo&
  512.  
  513. DATA "$VER: ReqToolsDemo.bas V1.0 $"